class Component < ActiveRecord::Base
  belongs_to :project
  belongs_to :template
  has_and_belongs_to_many :images

  #acts_as_taggable

  validates_presence_of :template, :title, :name, :project

  # active_scaffold callbacks: authorized_for_crud
  def authorized_for_create?
    true
  end

  def authorized_for_read?
    true
  end

  def authorized_for_update?
    true
  end

  def authorized_for_destroy?
    true
  end

  # human names
  ModelName = "组成部分"
  ColumnNames ={
    :project => "所属项目",
    :name => "名称",
    :title => "内容标题",
    :body => "内容文本",
    #:tag_list => "标签",
    :template => "使用模板",
    :images => "使用图片"
  }
end
